﻿//------------------------------------------------------------
// AureFramework
// Developed By Drunk Fish
// GitHub: https://github.com/YYYurz
// Gitee: https://gitee.com/yyyurz
//------------------------------------------------------------

using UnityEngine;

namespace AureFramework.Entity
{
	/// <summary>
	/// 实体逻辑父类
	/// </summary>
	public abstract class EntityLogic : MonoBehaviour
	{
		/// <summary>
		/// 实体Id
		/// </summary>
		[HideInInspector]
		public int Id;

		/// <summary>
		/// 所属实体组
		/// </summary>
		[HideInInspector]
		public IEntityGroup Group;
		
		/// <summary>
		/// 实体初始化
		/// </summary>
		public abstract void OnInit();
		
		/// <summary>
		/// 实体显示
		/// </summary>
		/// <param name="userData">用户自定义数据</param>
		public abstract void OnShow(object userData);

		/// <summary>
		/// 实体轮询
		/// </summary>
		/// <param name="elapseTime"> 距离上一帧的流逝时间，秒单位 </param>
		/// <param name="realElapseTime"> 距离上一帧的真实流逝时间，秒单位 </param>
		public abstract void OnUpdate(float elapseTime, float realElapseTime);

		/// <summary>
		/// 实体物理轮询
		/// </summary>
		/// <param name="fixedElapseTime"></param>
		/// <param name="realFixedElapseTime"></param>
		public abstract void OnFixedUpdate(float fixedElapseTime, float realFixedElapseTime);
		
		/// <summary>
		/// 实体隐藏。
		/// </summary>
		public abstract void OnHide();
		
		/// <summary>
		/// 实体销毁
		/// </summary>
		public abstract void OnDestroy();
	}
}